<!DOCTYPE html>
<html>
<head>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
        <meta content="noindex, nofollow" name="robots">
        <script src="audiorecorder.js" type="text/javascript"></script>
        <link href="/library/skin/tool_base.css" rel="stylesheet" type="text/css" />
        <link href="fck_dialog_common.css" rel="stylesheet" type="text/css" />
        <link href="audiorecorder.css" rel="stylesheet" type="text/css" />
        <script src="/library/webjars/wavesurfer.js/5.1.0/dist/wavesurfer.min.js"></script>
        <script src="/library/webjars/wavesurfer.js/5.1.0/dist/plugin/wavesurfer.microphone.min.js"></script>
        <script type="text/javascript" src="/library/webjars/jquery/1.12.4/jquery.min.js"></script>
        <script type="text/javascript" src="/library/js/recorder/recorder.js"></script>
        <script type="text/javascript" src="/library/js/sakai-recorder.js"></script>
        <script type="text/javascript">
                          var postUrl = oEditor.config.fileConnectorUrl+'&Command=QuickUploadAttachment';
                          function updateUrl(url) {
                              document.getElementById("txtUrl").value = (url);
                          }

                          $(document).ready(function() {
                            var maxSeconds = oEditor.config.audiorecorder.maxSeconds
                            var attemptsAllowed = oEditor.config.audiorecorder.attemptsAllowed
                            var attemptsRemaining = oEditor.config.audiorecorder.attemptsRemaining

                            var $elem = $("#ckaudiorecorder");
                            var sakaiAudioRecorder = new SakaiRecorder($elem);
                            sakaiAudioRecorder.init({
                              ckEditor: true,
                              maxSeconds: maxSeconds,
                              attemptsAllowed: attemptsAllowed,
                              attemptsRemaining: attemptsRemaining,
                              postUrl: postUrl
                            });
                          });
        </script>
</head>

<!-- For i18n support: 
To write text:
<script type="text/javascript">document.write(oEditor.lang.common.browseServer)</script>

To change a value
<script type="text/javascript">document.getElementById("btnBrowse").value = oEditor.lang.common.browseServer;</script>

Local i18n items are in oEditor.lang.audiorecorder.*

-->
<body scroll="no" id="ckaudiorecorder">
                

<p id="audio-recorder-intro">
  <script>document.write(oEditor.lang.audiorecorder.intro)</script>
    <span id="audio-time-allowed" style="display:none"> </span>
    <span id="audio-attempts" style="display:none"> </span>

  <div class="audio-controls">
    <div class="audio-timer-wrapper"><span class="audio-timer">00</span> / <span class="audio-max-time">30</span> <span><script>document.write(oEditor.lang.audiorecorder.seconds_label)</script></span></div>
    <button class="audio-record"><script>document.write(oEditor.lang.audiorecorder.record)</script></button>
    <button class="audio-stop" disabled><script>document.write(oEditor.lang.audiorecorder.stop)</script></button>
    <button class="audio-play" disabled><script>document.write(oEditor.lang.audiorecorder.play)</script></button>
    <button class="btn btn-primary text-white audio-upload" disabled><script>document.write(oEditor.lang.audiorecorder.post)</script></button>
    <div id="audio-posting" style="display:none"><script>document.write(oEditor.lang.audiorecorder.posting)</script></div>
    <div id="audio-finished" style="display:none"><script>document.write(oEditor.lang.audiorecorder.complete)</script></div>
    <div id="audio-statusbar" style="display:none"> </div>
    <div id="audio-levelbar"> </div>
    <div id="txtUrl" style="display:none"></div>
    <div id="audio-analyzer" class="audio-analyzer" style="display:block"></div>
    <div id="playback-analyzer" class="playback-analyzer" style="display:none"></div>
  </div>

  <audio class="audio-html5" style="display:none"> </audio>
  <div id="audio-debug-log" style="display:none">
    <h2>Log</h2>
    <pre id="log"></pre>
  </div>

          <!-- Would be nice if the Browse Server button could go here -->
          <div id="tdBrowse" style="display: none" rowspan="2">
              <input id="btnBrowse" onclick="BrowseServer();" type="button" value="Browse Server" />
              <script type="text/javascript">document.getElementById("btnBrowse").value = oEditor.lang.common.browseServer;</script>
          </div>
                
</body>
</html>
